home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / CoreGateway / StaticRecipient.cp < prev    next >
Encoding:
Text File  |  1995-07-28  |  3.8 KB  |  175 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        StaticRecipient.cp
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. /***********************************|****************************************/
  15.  
  16. #ifndef __BLJSTANDARDINCLUDES__
  17. #include "BLJStandardIncludes.h"
  18. #endif
  19.  
  20. #ifndef __STATICRECIPIENT__
  21. #include "StaticRecipient.h"
  22. #endif
  23.  
  24. #ifndef __UTILITIES__
  25. #include "Utilities.h"
  26. #endif
  27.  
  28. #pragma segment StaticRecipient
  29.  
  30. /***********************************|****************************************/
  31.  
  32. TStaticRecipient::TStaticRecipient ( const TRString& name, RecipientTypeSet type, RecipientStatusSet status, OSType addressType, const void* data, unsigned long length ):
  33.     TRecipient (),
  34.     fName ( name ),
  35.     fType ( type ),
  36.     fStatus ( status ),
  37.     fAddressType ( addressType ),
  38.     fData ( nil ),
  39.     fLength ( 0 )
  40. {
  41.     if ( data && length )
  42.     {    fData = new char [ length ];
  43.         if ( fData )
  44.             fLength = length;
  45.     }
  46. }
  47.  
  48. /***********************************|****************************************/
  49.  
  50. TStaticRecipient::TStaticRecipient ( const TRecipient* copied ):
  51.     TRecipient (),
  52.     fName (),
  53.     fData ( nil ),
  54.     fLength ( 0 )
  55. {
  56.     copied->GetRecipientName ( fName );
  57.      copied->GetRecipientType ( fType );
  58.      
  59.     fStatus = copied->GetStatus ();
  60.     
  61.     copied->GetCID ( fID );
  62. }
  63.  
  64. /***********************************|****************************************/
  65.  
  66. TStaticRecipient::~TStaticRecipient ()
  67. {
  68.     delete fData;
  69. }
  70.  
  71. /***********************************|****************************************/
  72.  
  73. Boolean
  74. TStaticRecipient::GetResponsible () const
  75. {
  76.     return false;
  77. }
  78.  
  79. /***********************************|****************************************/
  80.  
  81. Boolean
  82. TStaticRecipient::GetRecipientName ( TRString& name ) const
  83. {
  84.     name = fName;
  85.     return true;
  86. }
  87.  
  88. /***********************************|****************************************/
  89.  
  90. Boolean
  91. TStaticRecipient::GetRecipientType ( TRString& type ) const
  92. {
  93.     type = fType;
  94.     return true;
  95. }
  96.  
  97. /***********************************|****************************************/
  98.  
  99. Boolean
  100. TStaticRecipient::GetDirectoryName ( DirectoryName& ) const
  101. {
  102.     return false;
  103. }
  104.  
  105. /***********************************|****************************************/
  106.  
  107. Boolean
  108. TStaticRecipient::SetStatus ( RecipientStatusSet status )
  109. {
  110.     fStatus = status;
  111.     return true;
  112. }
  113.  
  114. /***********************************|****************************************/
  115.  
  116. RecipientStatusSet
  117. TStaticRecipient::GetStatus () const
  118. {
  119.     return fStatus;
  120. }
  121.  
  122. /***********************************|****************************************/
  123.  
  124. unsigned long TStaticRecipient::GetExtensionDataSize(void)const
  125. {
  126.     return 0;
  127. }
  128.  
  129. /***********************************|****************************************/
  130.  
  131. OSType
  132. TStaticRecipient::GetAddressType ( void ) const
  133. {
  134.     return fAddressType;
  135. }
  136.  
  137. /***********************************|****************************************/
  138.  
  139. void
  140. TStaticRecipient::GetExtensionData ( unsigned long offset, void * buffer, unsigned long bufferSize) const
  141. {
  142.     unused(offset); unused(buffer); unused(bufferSize);
  143. }
  144.  
  145. /***********************************|****************************************/
  146.  
  147. unsigned short TStaticRecipient::GetPathNameCount() const
  148. {
  149.     return 0;
  150. }
  151.  
  152. /***********************************|****************************************/
  153.  
  154. void TStaticRecipient::GetPathNameItem(unsigned short, TRString& ) const
  155. {
  156.     //    This should really do something.
  157. }
  158.  
  159. /***********************************|****************************************/
  160.  
  161. Boolean TStaticRecipient::GetPathDNode(unsigned long&)const
  162. {
  163.     //    This should really do something.
  164.     return 0;
  165. }
  166.  
  167. /***********************************|****************************************/
  168.  
  169. Boolean TStaticRecipient::GetCID(CreationID&  cid) const
  170. {
  171.     return false;
  172. }
  173.  
  174. /***********************************|****************************************/
  175.